Imports System.Data.SqlClient
Imports Microsoft.ApplicationBlocks.Data.SqlHelper
Public Class Insumos
    Public Function GenerarInsYNDI(ByVal ParamArray Dat() As String)
        Dim DS As New DataSet
        DS = Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteDataset(My.Settings.MiCadena, _
        CommandType.StoredProcedure, "InsumoYNDIGenerar", New SqlParameter("@NomNDI", Dat(0)), New SqlParameter("@ObsNDI", Dat(1)), _
        New SqlParameter("@MTSI", Dat(2)), New SqlParameter("@ObsI", Dat(3)), New SqlParameter("@FecI", CDate(Dat(4))))
        Return DS
    End Function

    Public Function GenerarItemsDeInsumos(ByVal ParamArray Dat() As String)
        Dim DS As New DataSet
        REM Falta modif.
        DS = Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteDataset(My.Settings.MiCadena, _
        CommandType.StoredProcedure, "InsumosGenerar", New SqlParameter("@NomNDI", Dat(0)), New SqlParameter("@ObsNDI", Dat(1)), _
        New SqlParameter("@NomI", Dat(2)), New SqlParameter("@MTSI", Dat(3)), New SqlParameter("@FecI", Dat(4)), _
        New SqlParameter("@ObsI", Dat(5)))
        Return DS
    End Function

    Public Function ModificarInsumos(ByVal ParamArray Dat() As String)
        Dim DS As New DataSet
        DS = Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteDataset(My.Settings.MiCadena, _
        CommandType.StoredProcedure, "InsumosModificar", New SqlParameter("@Cod", Dat(0)), New SqlParameter("@Nom", Dat(1)), _
        New SqlParameter("@Tip", Dat(2)))
        Return DS
    End Function

    Public Function ObtenerInsumos(ByVal ParamArray Dat() As String)
        Dim DS As New DataSet
        DS = Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteDataset(My.Settings.MiCadena, _
        CommandType.StoredProcedure, "InsumosObtener", New SqlParameter("@NomEleNDI", Dat(0)), New SqlParameter("@NomClaMTS", Dat(1)), _
         New SqlParameter("@NomCuaCom", Dat(2)), New SqlParameter("@NomFab", Dat(3)), New SqlParameter("@Cod", Dat(4)), _
         New SqlParameter("@Tip", Dat(5)))
        Return DS
    End Function

    Public Function ObtenerIngresosInsumos() As DataSet
        Dim DTIngresosInsumos As New DataSet
        DTIngresosInsumos = Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteDataset(My.Settings.MiCadena, "IngresosInsumosObtener")
        Return DTIngresosInsumos
    End Function
End Class
